function peixun(a, b) {
  loadScript('//js.andisk.com/appjs/metadata.js', function() {
    var d = {}
    d.intime = new Date().getTime()
    d.userid = meta.compile(a)
    d.type = b
    var c = '//admin.andisk.com/andisk/servlet/topeixun'
    $.ajax({
      type: 'POST',
      url: c,
      data: d,
      async: false,
      dataType: 'jsonp',
      success: function(h) {
        console.log('')
        var g = h
        if (g.rtn == 1) {
          var i = g.app
          var e = g.user
          var f = ''
          if (e.role >= 300) {
            f =
              i.web_url +
              '/' +
              i.template +
              '/console.html?ud=' +
              meta.compile(a)
            if (i.web_url.indexOf('andisk.com') < 0) {
              f = i.web_url + '/console.html?ud=' + meta.compile(a)
            }
          } else {
            if (e.role >= 200) {
              f =
                i.web_url + '/' + i.template + '/ta.html?sid=' + meta.compile(a)
              if (i.web_url.indexOf('andisk.com') < 0) {
                f = i.web_url + '/ta.html?sid=' + meta.compile(a)
              }
            } else {
              f =
                i.web_url + '/' + i.template + '/p.html?sid=' + meta.compile(a)
              if (i.web_url.indexOf('andisk.com') < 0) {
                f = i.web_url + '/p.html?sid=' + meta.compile(a)
              }
            }
          }
          to(f)
        } else {
          if (g.rtn == -1) {
            var i = g.app
            var f = i.web_url + '/' + i.template + '/bind.html?ud=' + a
            if (i.web_url.indexOf('andisk.com') < 0) {
              f = i.web_url + '/bind.html?ud=' + a
            }
            to(f)
          } else {
            if (g.rtn == 0) {
              var f = '/andisk/app/error.html?c=-1'
              to(f)
            }
          }
        }
      },
      error: function(e, g, f) {
        console.log('')
      }
    })
  })
}
function to(a) {
  var b = document.createElement('a')
  b.target = '_blank'
  b.style.display = 'none'
  b.href = a
  document.body.appendChild(b)
  b.click()
  return
}
function loadScript(a, c) {
  if ($("script[src='" + a + "']").length > 0) {
    if (c) {
      c(2)
    }
    return
  }
  var d = document.getElementsByTagName('head')[0]
  var b = document.createElement('script')
  b.setAttribute('type', 'text/javascript')
  b.setAttribute('src', a)
  d.appendChild(b)
  b.onload = b.onreadystatechange = function() {
    if (
      !this.readyState ||
      this.readyState == 'loaded' ||
      this.readyState == 'complete'
    ) {
      if (c) {
        c(1)
      }
      return
    }
  }
}
